#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "clistenerimpl.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT
signals:
    void signal_show_msg(const QString&msg);
public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
protected:
    void OnInitDialog();
private:
    void OnConnect(char *host,int host_len,uint16_t port,bool conn);
    void OnMessage(char* data,int data_len);
private:
    Ui::MainWindow *ui;
    ServerListenerImpl m_listener{};
    ITcpServer *m_client{};
};
#endif // MAINWINDOW_H
